package com.neusoft.boot32.dibuy.controller;

import com.neusoft.boot32.dibuy.entity.Role;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @program: springboot32
 * @description:
 * @author: Jingdi.Duan ,duanjingdi@msn.com
 * @create: 2024-07-11 14:19
 **/

@RestController
@RequestMapping("role")
@Tag(name = "角色管理控制器")
public class RoleController {
    @Operation(summary = "获得所有的角色列表")
    @GetMapping("/q/all")
    public ResponseEntity<List<Role>> all(){
        return ResponseEntity.ok(List.of(  new Role() ));
    }

//
//    @Operation(summary = "普通body请求")
//    @PostMapping("/body")
//    public ResponseEntity<FileResp> body(@RequestBody FileResp fileResp){
//        fileResp.setSize( System.currentTimeMillis()  );
//        return ResponseEntity.ok(fileResp);
//    }
//
//    @Operation(summary = "普通body请求+Param+Header+Path")
//    @Parameters({
//            @Parameter(name = "id",description = "文件id",in = ParameterIn.PATH),
//            @Parameter(name = "token",description = "请求token",required = true,in = ParameterIn.HEADER),
//            @Parameter(name = "name",description = "文件名称",required = true,in=ParameterIn.QUERY)
//    })
//    @PostMapping("/bodyParamHeaderPath/{id}")
//    public ResponseEntity<FileResp> bodyParamHeaderPath(@PathVariable("id") String id, @RequestHeader("token") String token, @RequestParam("name")String name, @RequestBody FileResp fileResp){
//        fileResp.setName(fileResp.getName()+",receiveName:"+name+",token:"+token+",pathID:"+id);
//        return ResponseEntity.ok(fileResp);
//    }
}
